<template>
  <div>
    <div>
      <el-form :model="queryHigher" >
        <el-row >
          <el-col :span="5">
        <el-form-item label="楼盘名称:" >
          <el-input v-model="queryHigher.higherName" placeholder="楼盘名称" style="width:70%;float:left"></el-input>
        </el-form-item>
      </el-col>
      <el-col :span="5">
        <el-form-item label="建筑单位:">
          <el-input v-model="queryHigher.higherUnit" placeholder="建筑单位" style="width:70%;float:left"></el-input>
        </el-form-item>
      </el-col>
      <el-col :span="6">
        <el-form-item label="预售许可证号:">
          <el-input v-model="queryHigher.higherLicenceno" placeholder="预售许可证号" style="width:60%;float:left"></el-input>
        </el-form-item>
      </el-col>
      <el-col :span="5">
        <el-form-item label="楼盘状态:">
          <el-select v-model="queryHigher.higherStatus" placeholder="请选择楼盘状态" style="width:70%;float:left">
            <el-option label="请选择" value=""></el-option>
            <el-option label="五证齐全" value="五证齐全"></el-option>
            <el-option label="在建查封" value="在建查封"></el-option>
          </el-select>
        </el-form-item>
      </el-col>
      <el-col :span="2">
        <el-form-item>
          <el-button type="primary" @click="queryAll">查询</el-button>
        </el-form-item>
      </el-col>
      </el-row>
      </el-form>
    </div>
    <div id="table1">
      <el-table
        :data="HigherList"
        style="width: 100%;  line-height: 50%"
        border
        @row-click="rowClick"
      >
        <el-table-column prop="higherId" label="楼盘id" width="180" v-if="false">
        </el-table-column>
        <el-table-column prop="higherName" label="楼盘名称" width="180">
        </el-table-column>
        <el-table-column prop="higherUnit" label="建筑单位" width="180">
        </el-table-column>
        <el-table-column prop="proposerName" label="项目负责人">
        </el-table-column>
        <el-table-column prop="higherLicenceno" label="预售许可证号">
        </el-table-column>
        <el-table-column prop="higherStatus" label="楼盘状态">
        </el-table-column>
        <el-table-column prop="assignee" label="资料员"> </el-table-column>
      </el-table>
    </div>
    <div class="divPage">
      <el-pagination
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        :current-page="queryHigher.currentPage"
        :page-sizes="[5, 10, 20, 100]"
        :page-size="queryHigher.pageSize"
        layout="total, sizes, prev, pager, next, jumper"
        :total="page.total"
      >
      </el-pagination>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      queryHigher:{
        higherName:"",
        higherUnit:"",
        higherStatus:"",
        higherLicenceno:"",
        currentPage:1,
        pageSize:5,
      },
      page:{
        total:0
      },
      HigherList: [],
    };
  },
  methods: {
    queryAll() {
      this.$axios.post("presell-serv/Highers/queryAll",this.queryHigher).then((res) => {
        if (res.data.code == 200) {
          this.HigherList = res.data.data.highers.list;
          this.page.total=res.data.data.highers.total;
        }
      });
    },
    rowClick(row,column){
      window.localStorage.setItem("hid",row.higherId);
      this.$router.push("/Higher");
    },
    //每页显示的条数变化时
    handleSizeChange(val) {
      this.queryHigher.pageSize = val;
      this.queryAll();
    },
    // 当前页数变化时
    handleCurrentChange(val) {
      this.queryHigher.currentPage = val;
      this.queryAll();
    },
  },
  created() {
    this.queryAll();
  },
};
</script>

